package tjs.study.notes.queue.producer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import tjs.study.notes.queue.producer.kafka.defaultStream.SendService;
import tjs.study.notes.queue.producer.kafka.initial.InitialKafkaService;
import tjs.study.notes.queue.producer.kafka.myStream.MySendService;

@SpringBootApplication
public class QueueProducerApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(QueueProducerApplication.class, args);
    }

    @Autowired
    private SendService sendService;
    @Autowired
    private MySendService mySendService;
    @Autowired
    private InitialKafkaService initialKafkaService;

    @Override
    public void run(String... args) throws Exception {
        for (int i = 0; i < 3000; i++) {
            initialKafkaService.sendMsg("tjs_test_cousumer6", String.valueOf(i));
            Thread.currentThread().sleep(300);
        }
    }
}

